package com.yjq.blog.article.dto;

import com.yjq.blog.article.entity.ArticleType;
import lombok.Data;
import lombok.ToString;
import org.springframework.beans.BeanUtils;
import org.springframework.cglib.beans.BeanCopier;

import java.util.List;

@Data
@ToString
public class ArticleTypeListDTO {

    private Integer id;

    private Integer parentId;

    private Integer level;

    private String title;

    private String titleCn;

    private List<ArticleTypeListDTO> children;

    public static ArticleTypeListDTO copy(ArticleType articleType) {
        ArticleTypeListDTO dto = new ArticleTypeListDTO();
        BeanUtils.copyProperties(articleType, dto);
        return dto;
    }
}
